﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="RestaurantList.aspx.vb" Inherits="WebApplication3.RestaurantList" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
    DataKeyNames="ID" DataSourceID="SqlDataSource1">
    <Columns>
        <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" 
            ReadOnly="True" SortExpression="ID" />
        <asp:HyperLinkField DataNavigateUrlFields="RAddress" 
            DataNavigateUrlFormatString="http://maps.google.co.uk/maps?q={0}" 
            DataTextField="RAddress" HeaderText="Restaurant Location (Google Maps)" />
        <asp:BoundField DataField="RName" HeaderText="RName" SortExpression="RName" />
        <asp:BoundField DataField="AveragePriceInPounds" 
            HeaderText="AveragePriceInPounds" SortExpression="AveragePriceInPounds" />
        <asp:BoundField DataField="Tel" HeaderText="Tel" SortExpression="Tel" />
        <asp:ImageField DataAlternateTextField="RName" DataImageUrlField="RPicture" 
            HeaderText="Restaurant Thumbnail ">
            <ControlStyle Height="150px" Width="150px" />
        </asp:ImageField>
        <asp:HyperLinkField DataNavigateUrlFields="RWebsite" 
            DataNavigateUrlFormatString="{0}" DataTextField="RName" HeaderText="Link" />
    </Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
    ConnectionString="<%$ ConnectionStrings:RestaurantConnectionString %>" 
    ProviderName="<%$ ConnectionStrings:RestaurantConnectionString.ProviderName %>" 
    SelectCommand="SELECT [ID], [RName], [RAddress], [RWebsite], [RPicture], [AveragePriceInPounds], [Tel] FROM [Restaurants]">
</asp:SqlDataSource>
</asp:Content>
